// 特殊作业

import {
    fitChartSize,
    fitSliderSizeHeight,
    fitSliderSizeWidth,
} from "@/utils/styleUtil.js";
import * as Echarts from "echarts";

let my_option = {
    columns1: [
        {
            label: "网格名称",
            prop: "title",
            width: "100",
            row_hidden: true,
            text_align: 'text_left',
        },

        {
            label: "检测率",
            prop: "col2",
            isSlot: true
        },
    ],
    columns2: [
        {
            label: "序号",
            prop: "title",
            width: "60",
        },
        {
            label: "网格名称 (三级)",
            prop: "col2",
        },
        {
            label: "上级网格 (二级)",
            prop: "col3",
        },
        {
            label: "网格人数",
            prop: "col4",
        },
    ],

    list_columns: [
        {
            label: "开始时间",
            prop: "title",
            width: "200",
        },
        {
            label: "结束时间",
            prop: "col2",
            width: "200",
        },
        {
            label: "特殊作业名称",
            prop: "col3",
        },
        {
            label: "类型",
            prop: "col4",
            width: "130",
            isSlot: true,
        },
        {
            label: "现场负责人",
            prop: "col5",
            width: "130",
        },
        {
            label: "作业结果",
            prop: "col6",
            width: "130",
            isSlot: true,
        },
        {
            label: "操作",
            prop: "col7",
            width: "130",
            isClick: true,
            textColor: "#2EF7FC",
        },
    ],
    option_pie: {
        grid: {
            top: 0,
            bottom: 0,
            left: fitChartSize(0),
            right: fitChartSize(0),
            // containLabel: true,
        },
        color: [
            "#2B8EF3",
            "#48E5E5",
            "#3254DD",
            "#BEE5FB",
            "#3CD495",
            "#5AC3FF ",
            "#27B9CC",
            "#564AF1",
        ],
        tooltip: {
            trigger: "item",
        },
        legend: {
            show: true,
            top: "middle",
            right: fitChartSize(5),
            orient: "vertical",
            textStyle: {
                fontSize: fitChartSize(12),
                fontFamily: "SourceHanSansCN-Regular",
                fontWeight: 400,
                color: "#FFFFFF",
                textStyle: {
                    rich: {
                        a: {
                            align: "left",
                            width: 50,
                        },
                        b: {
                            align: "left",
                            fontWeight: "bold",
                            width: 40,
                        },
                    },
                },
            },
        },

        align: "center",
        triggerEvent: true,
        series: [
            {
                type: "pie",
                left: 0,
                radius: ["50%", "75%"],
                avoidLabelOverlap: false,
                label: {
                    show: false,
                    position: "center",
                    formatter: "\n" + "\n" + "{num|{c}}" + "\n" + "{title|{b}}",
                    rich: {
                        title: {
                            // fontSize: fitChartSize(21),
                            fontSize: fitChartSize(20),
                            color: "white",
                            fontStyle: "normal",
                            fontWeight: 400,
                        },
                        num: {
                            // fontSize: fitChartSize(15),
                            fontSize: fitChartSize(28),
                            color: "#2EF7FC",
                            fontFamily: "DIN",

                            fontStyle: "normal",
                            fontWeight: "700",
                            lineHeight: fitChartSize(28),
                            /* identical to box height, or 100% */
                            textTransform: "uppercase",

                            backgroundClip: "text",
                            textFillColor: "transparent",
                        },
                    },

                    height: fitChartSize(140),
                    width: fitChartSize(140),
                    lineHeight: fitChartSize(25),
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: fitChartSize(18),
                        fontWeight: "bold",
                    },
                },
                labelLine: {
                    show: false,
                },
            },
        ],
    },
    option_bar: {
        grid: {
            left: fitChartSize(10),
            right: fitChartSize(1),
            top: fitChartSize(40),
            bottom: fitChartSize(10),
            containLabel: true,
        },
        xAxis: {
            type: "category",
            // name: "                               危险源数量",
            nameLocation: "middle",
            // nameGap: fitChartSize(35),
            nameTextStyle: {
                color: "#ffffff",
                align: "left",
            },
            data: ["2月", "3月", "4月", "5月", "6月", "7月"],
            max: 5,
            splitNumber: 6,
            axisLine: {
                // 坐标轴 轴线
                show: true, // 是否显示
                // ------   线 ---------
                lineStyle: {
                    color: "#ffff",
                    width: 1,
                    type: "solid",
                },
            },
        },
        yAxis: {
            type: "value",
            name: "数量",
            nameLocation: "end",
            nameTextStyle: {
                color: "#ffffff",
            },
            splitNumber: 4,
            axisLine: {
                // 坐标轴 轴线
                show: true, // 是否显示
                // ------   线 ---------
                lineStyle: {
                    color: "#ffff",
                    width: 1,
                    type: "solid",
                },
            },
            splitLine: {
                lineStyle: {
                    color: "rgb(255, 255, 255, 0.2)",
                    type: "dashed",
                },
            },
        },
        series: [
            {
                type: "bar",
                barWidth: fitChartSize(20),
                itemStyle: {
                    color: new Echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        {
                            offset: 1,
                            color: "#169FC4",
                        },
                        {
                            offset: 0,
                            color: "#10DAD3",
                        },
                    ]),
                },
            },
        ],
    },
};

export { my_option };
